package com.ghsc.ghxc.jsb.ui.live.view

import android.view.View
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import com.cn.appcore.ext.setSingleClickListener
import com.ghsc.ghxc.jsb.R
import com.ghsc.ghxc.jsb.ui.live.bean.LiveMessageDataBean
import com.lxj.xpopup.core.BottomPopupView

/**
 * 项目：JingShortVideo
 * 包名：com.bbl.jyShortVideo.ui.video.live.view
 * 类名：LiveSharePopupView
 * 创建时间：2022/12/21 17:00
 * 创建人 @author： xiaolin
 * 描述 ：Todo...主播设置
 */
class LiveSetPopupView(context: AppCompatActivity, messageBean: LiveMessageDataBean,
                       msgConfirm:()->Unit, msgCancel:()->Unit,
                       tvBtnSee:()->Unit
) : BottomPopupView(context) {



    private var msgConfirm: () -> Unit = msgConfirm
    private var msgCancel: () -> Unit = msgCancel
    private var tvBtnSee: () -> Unit = tvBtnSee
    val messageBean =messageBean

    override fun getImplLayoutId() = R.layout.live_set_up
    private val mContext = context



    override fun onCreate() {
        super.onCreate()
        var tvName=findViewById<TextView>(R.id.tvName)
        tvName.text=messageBean.model.userNick
        findViewById<TextView>(R.id.tvMsgTrue).setSingleClickListener {
            msgConfirm.invoke()
            dismiss()
        }
        findViewById<TextView>(R.id.tvMsgFalse).setSingleClickListener {
            msgCancel.invoke()
            dismiss()
        }
        findViewById<TextView>(R.id.tvBtnCancel).setSingleClickListener {
            dismiss()
        }
        findViewById<TextView>(R.id.tvBtnSee).setSingleClickListener {
            tvBtnSee.invoke()
            dismiss()
        }

    }

    override fun getMaxWidth() = 0
}